import { BasicColumn, FormSchema } from '/src/components/Table';

export const columns: BasicColumn[] = [
  {
    title: '接口名称',
    dataIndex: 'name',
    width: 200,
  },
  {
    title: 'URL1',
    dataIndex: 'url',
    width: 180,
  },
  {
    title: 'URL2',
    dataIndex: 'url2',
    width: 180,
  },
  {
    title: '数据更新周期',
    dataIndex: 'period',
    width: 180,
  },
  {
    title: '最高频率',
    dataIndex: 'request_frequency',
  },
  {
    title: '接口说明',
    dataIndex: 'comment',
  },
  {
    title: '返回数据格式',
    dataIndex: 'format',
  },
  {
    title: '更新时间',
    dataIndex: 'update_time',
  },
  {
    title: '开始时间',
    dataIndex: 'request_frequency',
  },
  {
    title: '总执行次数',
    dataIndex: 'count',
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'name',
    label: '接口名称',
    component: 'Input',
    colProps: { span: 8 },
    defaultValue: '',
  },
];

export const formSchema: FormSchema[] = [
  {
    field: 'name',
    label: '接口名称',
    required: true,
    component: 'Input',
  },
  {
    field: 'url',
    label: 'URL地址',
    required: true,
    component: 'Input',
  },
  {
    field: 'url2',
    label: 'URL地址2',
    required: true,
    component: 'Input',
  },
  {
    label: '备注',
    field: 'comment',
    component: 'InputTextArea',
  },
  {
    field: 'format',
    label: '响应数据格式',
    required: true,
    component: 'Input',
  },
];
